<!doctype html>

<div id="store_div"></div>
<div>This test passes if it does not crash or trip ASAN. See http://crbug.com/315889</div>

<script>
if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.waitUntilDone();
}
o0 = document.createElement('iframe');
o1 = document.documentElement;
o2 = document.createElement('iframe');
document.getElementById('store_div').appendChild(o2);
o3 = document.createElement('input');
o2.appendChild(o3);
o3.appendChild(o0);
window.setTimeout('window.callback1()',100);

function callback1() {
    window.setTimeout('window.callback2()',100);
}
function callback2() {
    o2.src = 'resources/freed-frame-helper.html';
}
var iterations = 0;
function called_from_helper() {
  if (++iterations > 20) {
    if (window.testRunner) {
      testRunner.notifyDone();
    }
    return;
  }
  o1.appendChild(o2);
}
</script>
